//创建mutations
export default {
    //累加
    increment(state) {
        state.count++
        localStorage.setItem('vuex-count',JSON.stringify(state))
    },
    //加n
    incrementN(state, { n }) {
        state.count += n
        localStorage.setItem('vuex-count',JSON.stringify(state))
    },
    //累减
    decrement(state) {
        state.count--
        localStorage.setItem('vuex-count',JSON.stringify(state))
    },
    //将请求回的列表设置给状态
    setMovieList(state, movieList) {
        state.movieList = movieList
        localStorage.setItem('vuex-count',JSON.stringify(state))
    },
    //等待2秒在加
    waitIncrement(state, { n }) {
        state.count += n
        localStorage.setItem('vuex-count',JSON.stringify(state))
    }
}